Skip to content

rewrite cryptography#134

Open
DavidBadura wants to merge 2 commits into2.0.xfrom
rewrite-cryptography
Open

rewrite cryptography#134
DavidBadura wants to merge 2 commits into2.0.xfrom
rewrite-cryptography

Conversation

@DavidBadura
Copy link
Member

@DavidBadura DavidBadura commented Dec 19, 2025

$hydrator->hydrate(
    ProfileCreated::class,
    [ // ...data... ],
    [
        SubjectIds::class => new SubjectIds(['account' => '<UUID>'])
    ]
);

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Hello 👋

here is the most recent benchmark result:

HydratorWithLazyBench
=====================

+------------------------------------------+--------------------+--------------------+-----------------+------------+
|                                          | time (kde mode)                         | memory                       |
+------------------------------------------+--------------------+--------------------+-----------------+------------+
| subject                                  | Tag: <current>     | Tag: base          | Tag: <current>  | Tag: base  |
+------------------------------------------+--------------------+--------------------+-----------------+------------+
| benchHydrate1Object ()                   | 0.800μs (±0.00%)   | 0.800μs (±0.00%)   | 2.770mb         | 3.251mb    |
| benchHydrate1ObjectTriggerInit ()        | 4.000μs (±0.00%)   | 4.200μs (±0.00%)   | 2.770mb         | 3.251mb    |
| benchHydrate1000Objects ()               | 429.000μs (±0.00%) | 442.333μs (±0.00%) | 2.800mb         | 3.262mb    |
| benchHydrate1000ObjectsTriggerInit ()    | 2.996ms (±0.00%)   | 3.064ms (±0.00%)   | 2.843mb         | 3.304mb    |
| benchHydrate1000000Objects ()            | 285.161ms (±0.00%) | 291.522ms (±0.00%) | 2.800mb         | 3.262mb    |
| benchHydrate1000000ObjectsTriggerInit () | 2.019s (±0.00%)    | 2.047s (±0.00%)    | 2.843mb         | 2.843mb    |
+------------------------------------------+--------------------+--------------------+-----------------+------------+

HydratorBench
=============

+-------------------------------+------------------+------------------+-----------------+------------+
|                               | time (kde mode)                     | memory                       |
+-------------------------------+------------------+------------------+-----------------+------------+
| subject                       | Tag: <current>   | Tag: base        | Tag: <current>  | Tag: base  |
+-------------------------------+------------------+------------------+-----------------+------------+
| benchHydrate1Object ()        | 3.400μs (±0.00%) | 3.400μs (±0.00%) | 2.770mb         | 2.770mb    |
| benchExtract1Object ()        | 4.000μs (±0.00%) | 4.000μs (±0.00%) | 2.770mb         | 2.770mb    |
| benchHydrate1000Objects ()    | 2.264ms (±0.00%) | 2.256ms (±0.00%) | 2.863mb         | 2.863mb    |
| benchExtract1000Objects ()    | 2.276ms (±0.00%) | 2.286ms (±0.00%) | 2.857mb         | 2.857mb    |
| benchHydrate1000000Objects () | 1.249s (±0.00%)  | 1.250s (±0.00%)  | 2.863mb         | 2.863mb    |
| benchExtract1000000Objects () | 1.435s (±0.00%)  | 1.442s (±0.00%)  | 2.857mb         | 2.857mb    |
+-------------------------------+------------------+------------------+-----------------+------------+

HydratorWithCryptographyBench
=============================

+-------------------------------+--------------------+------------------+-----------------+------------+
|                               | time (kde mode)                       | memory                       |
+-------------------------------+--------------------+------------------+-----------------+------------+
| subject                       | Tag: <current>     | Tag: base        | Tag: <current>  | Tag: base  |
+-------------------------------+--------------------+------------------+-----------------+------------+
| benchHydrate1Object ()        | 177.800μs (±0.00%) | 6.600μs (±0.00%) | 2.834mb         | 2.772mb    |
| benchExtract1Object ()        | 72.800μs (±0.00%)  | 9.000μs (±0.00%) | 2.828mb         | 2.772mb    |
| benchHydrate1000Objects ()    | 4.027ms (±0.00%)   | 3.550ms (±0.00%) | 3.014mb         | 3.040mb    |
| benchExtract1000Objects ()    | 6.397ms (±0.00%)   | 5.346ms (±0.00%) | 3.108mb         | 3.009mb    |
| benchHydrate1000000Objects () | 2.285s (±0.00%)    | 1.839s (±0.00%)  | 3.014mb         | 3.040mb    |
| benchExtract1000000Objects () | 4.222s (±0.00%)    | 3.597s (±0.00%)  | 3.108mb         | 3.009mb    |
+-------------------------------+--------------------+------------------+-----------------+------------+

This comment gets update everytime a new commit comes in!

@DavidBadura DavidBadura force-pushed the rewrite-cryptography branch 2 times, most recently from 1be9d96 to 300de93 Compare December 31, 2025 12:03
@DavidBadura DavidBadura force-pushed the rewrite-cryptography branch 4 times, most recently from 945a898 to a6e2fa0 Compare February 13, 2026 09:48
@DavidBadura DavidBadura marked this pull request as ready for review February 13, 2026 09:52
@DavidBadura DavidBadura added this to the 2.0.0 milestone Feb 13, 2026
@DavidBadura DavidBadura added BC break enhancement New feature or request labels Feb 13, 2026
public readonly ReflectionProperty $reflection,
public readonly string $fieldName,
public readonly Normalizer|null $normalizer = null,
public Normalizer|null $normalizer = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a leftover from wrapping the normalizers with the CryptoNormelizer. I have abandoned that idea. But I still think it is a useful API to override or wrap the normalizer – what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have said: keep it readonly as long as possible, just to make the API more stable, but we already have the extras array which can be manipulated 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need an area where I can add metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC break enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants